/* 
 * File:   FunctionNode.h
 * Author: jcrada
 *
 * Created on April 4, 2009, 4:53 PM
 */

#ifndef _FUNCTIONNODE_H
#define	_FUNCTIONNODE_H

#include "Node.h"

namespace jcrada {

    class FunctionNode : public Node {
    public:

        enum eFunctionType {
            FT_SWAP = 0, FT_MOVE, FT_COUNT,
        };

    private:
        eFunctionType _type;

    public:
        FunctionNode( int arity );
        virtual ~FunctionNode( );

        virtual void setType( eFunctionType type );
        virtual eFunctionType getType( ) const;

        virtual Node* getResult( ) const;

        virtual FunctionNode* clone( ) const;

        virtual std::string toString( ) const;
    };

    class FunctionListener {
    public:
        virtual ~FunctionListener(){};
        virtual void evaluate( const FunctionNode& function) = 0;
    };
}

#endif	/* _FUNCTIONNODE_H */

